package com.wpp.concurrent.demo5;

/**
 * @description:
 * @author: WangPengPeng
 * @create: 2022-01-23 21:16
 **/
public class Demo5Client4 {

    public static void main(String[] args) throws InterruptedException{
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                while (!Thread.currentThread().interrupted()) {

                }
                System.out.println("thread isInterrupted:" + Thread.currentThread().isInterrupted());
            }
        });
        thread.start();

        // 设置中断位
        thread.interrupt();

        thread.join();
        System.out.println("main is over");

    }
}
